//类型断言主要用于ts推断出来类型并不满足需求，手动指定一个类型
let a:unknown = 'hello'
a = 123;

//不会编译报错，a指定为[]数组，欺骗ts
(a as []).map(()=>{})

let b: string|undefined = undefined
//编译报错
//b.length

//非空断言
b!.length